package cs.sxh.service;

import cs.sxh.dao.UserMapper;
import cs.sxh.pojo.User;

import java.util.List;

/**
 * @author songxh
 * @create 2022-03-22-19:48
 */
public class UserServiceImpl implements UserService {

    private UserMapper userMapper;
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public User queryUserByUidAndPassword(String uid, String u_password) {
        return userMapper.queryUserByUidAndPassword(uid,u_password);
    }

    @Override
    public int updatePassword(String uid, String repassword) {
        return userMapper.updatePassword(uid,repassword);
    }

    @Override
    public User queryUserById(int id) {
        return userMapper.queryUserById(id);
    }

    @Override
    public List<User> queryAllUser() {
        return userMapper.queryAllUser();
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }
}
